# Copyright (c) 2008 Alvin Wang http://cloudwizard.com/
# License New BSD
# See README for additional information

"""DreamHost Cloud Support
"""


from cloudwizard.cloud import Cloud
from compute import Compute

class Dreamhost(Cloud):
    """
    aws_access_key_id = None
    aws_secret_access_key = None
    aws_key_pair = 'testa'
    ec2_conn = None	#?? how to encapsulate
    cloud_vartypes = ['aws_ami', 'aws_keypair', 'aws_secgroup', 'aws_ipaddr',
      'aws_disk']
    """
    cloud_name = "Dreamhost"
    cloud_abbrev = "dreamhost"
    cloud_vartypes = ['aws_ami', 'aws_keypair', 'aws_secgroup', 'aws_ipaddr',
      'aws_disk']
    cloud_services = ['compute', 'disk']
    cloud_userid_var = 'userid'
    cloud_password_var = 'password'

    def init_auth(self, **args):
        self.cw_process_options()
        self.prompt(question="system name for shell account", varname="system")
        self.prompt(question="Secret Key?",
            default='ami-84a5eed', vartype="aws_secret_key", varname="aws_secret_key")
        self.prompt(question="Secret Key?",
            default='ami-84a5eed', vartype="aws_secret_key", varname="aws_secret_key")

    def get_service(self, service=None, **args):
        """return a AWS service"""
        # could use lambda but it is more painful
        if service == "compute":
            return Compute(userid=self.cloud_userid, 
                password=self.cloud_password)



